//#define _CRTDBG_MAP_ALLOC
#include "StdAfx.h"
#include "GaussianBGModel.h"

GaussianBGModel::GaussianBGModel(void)
{
    bg_model = 0;
}
void GaussianBGModel::createGaussianBGModel(IplImage* frameImage)
{
    if(!bg_model)
    {
        //create BG model
        bg_model = cvCreateGaussianBGModel(frameImage);

    }

}

void GaussianBGModel::updateBGStatModel(IplImage* frameImage,int update_bg_model)
{
    //update_bg_model - will be -1 or 0
    cvUpdateBGStatModel( frameImage, this->bg_model,update_bg_model);
}

IplImage* GaussianBGModel::getBackGround()
{
   return bg_model->background;
}

IplImage* GaussianBGModel::getForeGround()
{
   return bg_model->foreground;
}